1 00:00:01,630 --> 00:00:02,630 Welcome back. 2 00:00:02,650 --> 00:00:07,810 This lecture is dedicated towards learning all about the table data type. 3 00:00:07,990 --> 00:00:12,520 Tables are super powerful and awesome because you can do so much with them. 4 00:00:12,520 --> 00:00:15,850 You can store a bunch of information in an organized manner. 5 00:00:15,850 --> 00:00:18,820 You can access information in an organized manner. 6 00:00:18,820 --> 00:00:24,790 You can assign data a key so you can reference it instantly, just like we do for variables and much 7 00:00:24,790 --> 00:00:25,280 more. 8 00:00:25,300 --> 00:00:31,930 However, before we start learning how to use tables, we first have to understand what exactly a table 9 00:00:31,930 --> 00:00:32,710 is. 10 00:00:32,860 --> 00:00:41,380 A table in Lua is a container of values in your code, just as the scripts in our game are containers 11 00:00:41,380 --> 00:00:42,700 for Lua code. 12 00:00:42,730 --> 00:00:47,260 A table is a container that holds values of many different data types. 13 00:00:47,290 --> 00:00:52,990 Tables are important because they allow us to organize and structure our data in a way that can be iterated 14 00:00:52,990 --> 00:00:53,680 over. 15 00:00:53,710 --> 00:00:55,390 What do I mean by iterate? 16 00:00:55,420 --> 00:01:00,950 Well, iteration is the repetitive execution of the same code over and over. 17 00:01:00,970 --> 00:01:06,430 If our tables did not store data in a predictable and organized manner, we would be unable to use the 18 00:01:06,430 --> 00:01:11,200 same code over and over again to iterate or look through all the data inside of the table. 19 00:01:11,230 --> 00:01:13,350 This is why tables are such a big deal. 20 00:01:13,360 --> 00:01:16,880 They provide us a tool to meaningfully organize our data. 21 00:01:16,900 --> 00:01:20,100 So let's go ahead and get started creating some tables. 22 00:01:20,110 --> 00:01:22,510 What I'm going to do is I'm going to create a variable here. 23 00:01:22,840 --> 00:01:26,260 I'm just going to call this example table. 24 00:01:26,830 --> 00:01:28,720 And then to create a table. 25 00:01:28,720 --> 00:01:31,810 As you remember earlier we use curly brackets. 26 00:01:31,810 --> 00:01:33,460 So I'm going to put my first one here. 27 00:01:33,460 --> 00:01:36,610 And then the second one automatically gets filled in for me already. 28 00:01:36,610 --> 00:01:40,180 And now we have an empty table or an empty container. 29 00:01:40,180 --> 00:01:43,720 There's no values stored inside of our table here. 30 00:01:43,720 --> 00:01:46,330 However, I can start filling it up with some values. 31 00:01:46,330 --> 00:01:51,340 For example, I can put the number ten here, and then to designate another value I'm going to put a 32 00:01:51,340 --> 00:01:54,220 comma, and then I can pass something like 35. 33 00:01:54,250 --> 00:01:58,840 If I want to store another value again we'll put another comma and we could do two. 34 00:01:58,930 --> 00:02:02,560 We could do something like 187 or a -33. 35 00:02:02,560 --> 00:02:06,880 And now here we have a table with five different values stored inside of it. 36 00:02:06,910 --> 00:02:11,170 This table right here is known as an array. 37 00:02:11,200 --> 00:02:16,090 Now an array is a data structure where values are stored chronologically. 38 00:02:16,120 --> 00:02:22,450 This means that the first value stored in the table will always be the first, and the last value stored 39 00:02:22,450 --> 00:02:25,290 inside of the table will always be the last. 40 00:02:25,300 --> 00:02:29,350 Each one of these values are assigned something called an index. 41 00:02:29,350 --> 00:02:33,310 As you remember in a string, each of the characters had a different index. 42 00:02:33,310 --> 00:02:35,620 Well, in tables it works the same way. 43 00:02:35,620 --> 00:02:42,250 Our first value has the index of one, our second value has the index of two, three, and so on. 44 00:02:42,250 --> 00:02:44,260 Through all the values in our table. 45 00:02:44,260 --> 00:02:49,540 This means we can access a specific value in this table by using the index. 46 00:02:49,540 --> 00:02:52,210 So what I'm going to do is I'm going to use my print function. 47 00:02:52,210 --> 00:02:55,030 And what we're going to do is we're going to pass the example table. 48 00:02:55,030 --> 00:02:58,840 And then to index this table we put a bracket. 49 00:02:58,840 --> 00:03:01,750 And then we can pass the index or the number. 50 00:03:01,750 --> 00:03:03,850 In this case we can pass one here. 51 00:03:03,850 --> 00:03:09,880 And this means I'm going to be grabbing the value that is stored at the first index inside of our table 52 00:03:09,880 --> 00:03:11,080 or our array. 53 00:03:11,080 --> 00:03:13,900 In this case that would be the value of ten. 54 00:03:14,410 --> 00:03:19,120 What I can also do is I can grab the last value inside of this table as well. 55 00:03:19,120 --> 00:03:27,100 And if you do not know the length of your table, we can get the length easily by again using that hashtag 56 00:03:27,100 --> 00:03:27,670 operator. 57 00:03:27,700 --> 00:03:29,020 This also works for tables. 58 00:03:29,020 --> 00:03:30,670 And then we can pass example table. 59 00:03:30,670 --> 00:03:37,630 And this will return a number that represents the length or how many values are stored inside of this 60 00:03:37,630 --> 00:03:38,010 array. 61 00:03:38,020 --> 00:03:40,870 So we have 12345 values. 62 00:03:40,870 --> 00:03:43,660 And that means this will return the number five. 63 00:03:43,900 --> 00:03:47,350 So if we go ahead and go to our test tab and hit run. 64 00:03:48,770 --> 00:03:55,250 As you can see, the first value we get at the first index is ten, and then the value at the last index, 65 00:03:55,250 --> 00:03:57,310 which was five, is -33. 66 00:03:57,320 --> 00:04:02,120 Just like that, we have access or index values inside of our table. 67 00:04:02,860 --> 00:04:09,550 Now indexing a table is great and all, but how can we insert and remove elements from our table during 68 00:04:09,550 --> 00:04:13,600 the runtime of our script, or during the execution of our game? 69 00:04:13,630 --> 00:04:17,020 Well, this is where the table library comes into play. 70 00:04:17,050 --> 00:04:17,500 That's right. 71 00:04:17,500 --> 00:04:23,950 We have another library inside of the Lua programming language to access the table library. 72 00:04:23,980 --> 00:04:24,810 It's easy. 73 00:04:24,820 --> 00:04:28,000 All we need to do is type out table and then we can index it. 74 00:04:28,000 --> 00:04:32,320 And here we have a bunch of different functions for manipulating tables. 75 00:04:32,350 --> 00:04:35,290 As you can see we can insert values into a table. 76 00:04:35,290 --> 00:04:37,750 And we can also remove values from table. 77 00:04:37,750 --> 00:04:39,160 We can clone tables. 78 00:04:39,160 --> 00:04:44,750 We can clear or remove all of the data inside of a table, and a whole bunch of other neat stuff. 79 00:04:44,770 --> 00:04:49,000 If you're more curious about all the functions available in the table library, there are plenty of 80 00:04:49,000 --> 00:04:52,340 articles and documentation detailing the functionality of each one. 81 00:04:52,360 --> 00:04:57,190 I'll leave a resource in this lecture detailing the other functions available in the table library. 82 00:04:57,430 --> 00:05:02,740 The first function I would like to demonstrate is going to be the insert function or inserting a new 83 00:05:02,740 --> 00:05:04,490 value inside of the table. 84 00:05:04,510 --> 00:05:09,790 As you can see, this function needs to be passed a table and then a value to be inserted into that 85 00:05:09,790 --> 00:05:10,370 table. 86 00:05:10,390 --> 00:05:12,460 So what I'm going to do is I'm going to create a variable. 87 00:05:12,460 --> 00:05:14,440 I'm going to call it new num. 88 00:05:14,620 --> 00:05:17,920 And we can store a number like 20. 89 00:05:18,100 --> 00:05:21,670 And then what I want to do is I want to pass my example table. 90 00:05:21,670 --> 00:05:26,950 And I would like to insert this value of 20 inside of our table. 91 00:05:26,950 --> 00:05:31,420 And what this is going to do is it's going to insert this value at the very last index. 92 00:05:31,420 --> 00:05:31,660 Right. 93 00:05:31,660 --> 00:05:35,920 Because whatever is first is first, and whatever is last is last. 94 00:05:35,920 --> 00:05:40,810 And when we insert objects into our array, it's going to insert them chronologically. 95 00:05:40,810 --> 00:05:44,250 It's not going to shove this number randomly between these other values. 96 00:05:44,260 --> 00:05:44,500 Nope. 97 00:05:44,500 --> 00:05:49,360 It's always going to go at the very end because that's how an array works. 98 00:05:49,570 --> 00:05:55,660 So now that means we can print out the entirety of our table, and we should be able to see this new 99 00:05:55,660 --> 00:05:58,180 value of 20 at the end of our table. 100 00:05:58,210 --> 00:05:59,740 So if we hit run here. 101 00:06:01,340 --> 00:06:02,150 Here's our table. 102 00:06:02,150 --> 00:06:06,080 We can hit this arrow to fully see all the values inside of it. 103 00:06:06,080 --> 00:06:11,150 And as you can see, the value of 20 is now stored at the sixth index in our table. 104 00:06:11,180 --> 00:06:16,820 Here we have ten at the first 35 at the second, two at the third one, 87 at the fourth, and then 105 00:06:16,820 --> 00:06:18,680 -33 at the fifth. 106 00:06:19,730 --> 00:06:25,730 We can also remove a value out of our table using the table remove function, and this function needs 107 00:06:25,730 --> 00:06:32,240 to be passed a table, and then it needs to be passed a number which represents the index where we would 108 00:06:32,240 --> 00:06:33,740 like a value to be removed. 109 00:06:33,740 --> 00:06:39,320 So for example, if I wanted to remove the first value inside of the table, I would pass my table. 110 00:06:39,470 --> 00:06:45,680 And then I would pass one to denote that I would like to remove the value at the first index. 111 00:06:45,680 --> 00:06:49,760 So that means our value of ten is going to be removed out of our table. 112 00:06:49,760 --> 00:06:55,130 And if we go ahead and print example table back into the console, as you can see when we hit run. 113 00:06:56,230 --> 00:06:58,120 And we go ahead and open this up. 114 00:06:58,150 --> 00:07:00,320 Our ten is no longer there. 115 00:07:00,340 --> 00:07:06,880 Previously, as you can see up here, the number ten was there, but now the number ten has disappeared. 116 00:07:07,900 --> 00:07:13,690 Now, something important to note is that we do not need to store the return value from these different 117 00:07:13,690 --> 00:07:17,890 functions back inside of our example table variable. 118 00:07:17,980 --> 00:07:23,260 When we pass our table to these different functions, what's happening is we're actually passing a reference 119 00:07:23,260 --> 00:07:27,100 to the table rather than a clone or copy of this table. 120 00:07:27,130 --> 00:07:33,430 This means when this function performs some manipulation on the table, it's automatically applied to 121 00:07:33,430 --> 00:07:35,920 the original values stored inside of our variable. 122 00:07:35,920 --> 00:07:42,430 This means we do not have to do something like example table is equal to the return value. 123 00:07:42,550 --> 00:07:49,660 This is the exact same thing as just doing this because it's automatically applied to our table. 124 00:07:49,690 --> 00:07:55,090 If you do not wish to have it automatically applied to the table, this is where you would have to create 125 00:07:55,090 --> 00:07:56,560 a clone of the table. 126 00:07:56,560 --> 00:07:59,500 And that's where we would use the table clone function. 127 00:07:59,500 --> 00:08:05,150 But before we get to that, another thing I would like to demonstrate is the table find function. 128 00:08:05,170 --> 00:08:12,190 So for example here let's say I have a table that's super big and I know I have a value in there somewhere 129 00:08:12,190 --> 00:08:18,880 I would like to remove, but I don't know what index or what position inside of my table that value 130 00:08:18,880 --> 00:08:19,450 is at. 131 00:08:19,480 --> 00:08:24,790 Well, what we could do is we could use the table dot find function. 132 00:08:24,790 --> 00:08:31,920 And what this function does is it returns the value or the index of where that value is stored. 133 00:08:31,930 --> 00:08:36,010 So I'm going to create a variable here I'm going to call it index. 134 00:08:36,400 --> 00:08:39,040 And it's going to be equal to table dot find. 135 00:08:39,040 --> 00:08:41,740 And I'm going to pass my example table. 136 00:08:41,920 --> 00:08:48,280 And then I need to pass the value that I would like to find inside of our table. 137 00:08:48,280 --> 00:08:51,970 And this instance it's considering our table the haystack. 138 00:08:51,970 --> 00:08:54,430 And then it considers the value of the needle. 139 00:08:54,430 --> 00:08:58,270 So we're finding the needle inside of the haystack or our table. 140 00:08:58,450 --> 00:09:04,060 In this case maybe I want to remove the 20 we just inserted inside of our table. 141 00:09:04,060 --> 00:09:06,190 So I can pass 20 here. 142 00:09:06,490 --> 00:09:12,370 And then if it finds the value of 20 inside of our table, then it's going to return the index that 143 00:09:12,370 --> 00:09:13,030 it's stored at. 144 00:09:13,300 --> 00:09:19,510 This means I can use my table dot remove function, and then pass the index here to remove the value 145 00:09:19,510 --> 00:09:21,100 of 20 out of our table. 146 00:09:21,490 --> 00:09:23,470 So if we go ahead and hit run again. 147 00:09:24,280 --> 00:09:28,030 And our first table we see 20 is inside of our table. 148 00:09:28,030 --> 00:09:32,830 And then when it gets printed again, as you can see, 20 is no longer inside of our table. 149 00:09:32,830 --> 00:09:34,540 It has been removed. 150 00:09:35,300 --> 00:09:36,080 Before we move on. 151 00:09:36,080 --> 00:09:39,120 I'm also going to demonstrate the tablecloth function. 152 00:09:39,140 --> 00:09:41,840 So what I'm going to do is I'm going to create another variable. 153 00:09:42,050 --> 00:09:44,210 I'm going to call this variable clone. 154 00:09:44,240 --> 00:09:47,180 And it's going to be equal to table dot clone. 155 00:09:47,180 --> 00:09:50,090 And all we need to pass to this is the table itself. 156 00:09:50,090 --> 00:09:51,560 So we'll pass example table. 157 00:09:51,560 --> 00:09:58,670 And now inside of this variable we have stored a copy or a new table that is a direct clone of this 158 00:09:58,670 --> 00:09:59,620 table right here. 159 00:09:59,630 --> 00:10:05,810 So what's stored in this variable is completely different to what's stored inside of this variable. 160 00:10:05,810 --> 00:10:06,930 They are not the same. 161 00:10:06,950 --> 00:10:14,360 This means if I were to use something like the table dot clear function to remove all of the data inside 162 00:10:14,360 --> 00:10:19,460 of our table, and I pass clone here, what's going to happen is clone is going to be completely empty. 163 00:10:19,670 --> 00:10:23,750 If I print clone into the console, we're just going to get an empty table. 164 00:10:23,780 --> 00:10:29,330 However, if I print out our example table, this table here should still be filled with all of the 165 00:10:29,330 --> 00:10:31,830 values that we've originally placed inside of it. 166 00:10:31,850 --> 00:10:33,200 So if we hit run. 167 00:10:34,710 --> 00:10:36,540 Here we get our empty table. 168 00:10:36,540 --> 00:10:42,480 We removed all the values inside of it, but as you can see, our original table has remained unaffected, 169 00:10:42,480 --> 00:10:42,900 right? 170 00:10:42,930 --> 00:10:48,390 This is because we've created a clone of our original table and cleared all the values inside of it, 171 00:10:48,390 --> 00:10:51,180 but our original table remains unaffected. 172 00:10:52,160 --> 00:10:58,400 So you always need to use the table dot clone function when you want a clone of the table and manipulate 173 00:10:58,400 --> 00:11:00,080 only that particular clone. 174 00:11:00,170 --> 00:11:06,290 If I had a variable here and I instead I just stored the value that's inside of example table. 175 00:11:06,440 --> 00:11:12,910 This variable and this variable here are both referencing the exact same value. 176 00:11:12,920 --> 00:11:20,150 That means even though I use table dot clear on this variable, it's going to affect both of these variables 177 00:11:20,150 --> 00:11:25,160 because both variables are referring to the exact same table. 178 00:11:25,160 --> 00:11:26,630 So if I hit run. 179 00:11:27,700 --> 00:11:31,720 As you can see now I get two tables printed that are completely empty. 180 00:11:31,750 --> 00:11:35,830 It's because we did not clone the table right here. 181 00:11:35,830 --> 00:11:42,430 Instead, we've just referenced the exact same value and doing table dot clear on this variable did 182 00:11:42,430 --> 00:11:48,100 the exact same thing to this variable here because again they're referencing the same table. 183 00:11:48,100 --> 00:11:50,170 So that's a very important to understand and note. 184 00:11:50,380 --> 00:11:58,240 Use the table dot clone function when you absolutely need to clone an effect a copy of a table. 185 00:11:58,270 --> 00:11:58,840 All right. 186 00:11:58,840 --> 00:11:59,980 Very important. 187 00:12:00,250 --> 00:12:07,360 Now before we end this lecture I want to talk about the difference between dictionaries and arrays. 188 00:12:07,390 --> 00:12:12,430 Now we know a table is a data type that can encompass multiple different forms of storing data. 189 00:12:12,460 --> 00:12:17,010 The tables that we were messing with here earlier we know were arrays, right. 190 00:12:17,020 --> 00:12:21,700 However, there is another data type that we can create called a dictionary. 191 00:12:21,970 --> 00:12:28,810 And a dictionary is where you can assign a key to a value inside of your table. 192 00:12:28,840 --> 00:12:33,880 Basically, you're like creating a variable inside of the table, and you can reference that variable 193 00:12:33,880 --> 00:12:40,180 directly to instantly grab that value instead of having to mess with different numbers and stuff as 194 00:12:40,180 --> 00:12:41,050 the index. 195 00:12:41,830 --> 00:12:48,200 However, a big difference between dictionaries and arrays is that dictionaries are not ordered or organized. 196 00:12:48,220 --> 00:12:51,040 This means that order is not maintained. 197 00:12:51,040 --> 00:12:55,900 So if you were to ever iterate through a dictionary, which we're going to do later in the course, 198 00:12:55,900 --> 00:13:01,630 the first element is not guaranteed to actually be the first value stored inside of the table. 199 00:13:01,990 --> 00:13:04,840 So to create a dictionary, we do the exact same thing. 200 00:13:04,840 --> 00:13:06,490 We just put two curly brackets. 201 00:13:06,510 --> 00:13:08,410 I'm going to store this inside of a variable. 202 00:13:08,410 --> 00:13:11,350 I'm going to call it dictionary example. 203 00:13:12,610 --> 00:13:17,800 And what I can do here is I can define a key and a value to be stored with that key. 204 00:13:17,830 --> 00:13:20,300 It's called a key value pair. 205 00:13:20,330 --> 00:13:22,870 It's just as the name suggests you have a key. 206 00:13:22,900 --> 00:13:23,830 You got a value. 207 00:13:23,830 --> 00:13:25,420 And they're a pair together. 208 00:13:25,450 --> 00:13:26,080 Right. 209 00:13:26,110 --> 00:13:27,160 Very simple. 210 00:13:27,190 --> 00:13:30,220 So as an example here I'm going to create a key. 211 00:13:30,220 --> 00:13:32,830 And I'm just going to call this key one. 212 00:13:32,980 --> 00:13:38,560 And at key one I would like to store maybe the value of hello right a string. 213 00:13:38,740 --> 00:13:41,140 So here we have our key. 214 00:13:41,140 --> 00:13:42,490 And we have a value. 215 00:13:42,490 --> 00:13:44,710 And they are a pair together. 216 00:13:44,740 --> 00:13:50,500 If I would like to store another key value pair inside of our dictionary, we just put a comma to denote 217 00:13:50,530 --> 00:13:51,580 to the interpreter. 218 00:13:51,580 --> 00:13:54,720 Hey we would like to create another key value pair. 219 00:13:54,730 --> 00:13:56,830 So I'm just going to copy this here. 220 00:13:57,460 --> 00:13:59,920 And this time I'm going to call this key two. 221 00:14:00,070 --> 00:14:04,660 And maybe inside of key two I would like to store the Word of World. 222 00:14:05,180 --> 00:14:07,020 So now here we have our dictionary. 223 00:14:07,040 --> 00:14:09,470 We have key one which stores hello. 224 00:14:09,470 --> 00:14:11,720 And then we have key two which stores world. 225 00:14:11,720 --> 00:14:16,610 And that means we can directly access these different values by using their keys. 226 00:14:17,460 --> 00:14:22,860 So what we can do is we can reference our dictionary example variable. 227 00:14:22,860 --> 00:14:29,130 And then to access these keys we can directly index the table by using the dot operator. 228 00:14:29,130 --> 00:14:31,080 And here you can see our two keys. 229 00:14:31,080 --> 00:14:32,640 We have key one and key two. 230 00:14:32,670 --> 00:14:37,490 So if I did that this means I'm accessing the value stored in key one which is hello. 231 00:14:37,500 --> 00:14:42,410 Or if I did key two I am now accessing the value in key two which is world. 232 00:14:42,420 --> 00:14:47,070 And we can also do the exact same thing by using a string. 233 00:14:47,070 --> 00:14:47,850 And here we are. 234 00:14:47,850 --> 00:14:54,480 We have key one and key two because these different keys are automatically stored as strings. 235 00:14:54,480 --> 00:15:00,480 So if I print this out into the console we should get hello printed right here. 236 00:15:01,300 --> 00:15:07,150 And if I do print again and then refer to dictionary example and I index it and get key number two, 237 00:15:07,180 --> 00:15:10,630 we should get world printed out in the console right here as well. 238 00:15:10,660 --> 00:15:12,550 So let's go ahead and hit run. 239 00:15:14,010 --> 00:15:14,670 And there we go. 240 00:15:14,670 --> 00:15:17,190 We get hello, which is stored in that first key. 241 00:15:17,190 --> 00:15:20,040 And then we have world stored in that second key. 242 00:15:20,070 --> 00:15:20,880 Perfect. 243 00:15:21,730 --> 00:15:26,980 If I would like to insert or remove values out of our dictionary, it's much easier to do. 244 00:15:27,010 --> 00:15:30,490 We don't have to use the insert or remove function instead. 245 00:15:30,490 --> 00:15:33,830 What I could do is get my dictionary example. 246 00:15:33,850 --> 00:15:39,970 I can access, for example, key one and I can overwrite the value inside of there using the assignment 247 00:15:39,970 --> 00:15:40,770 operator. 248 00:15:40,780 --> 00:15:45,040 And maybe I want to replace the word with like howdy right. 249 00:15:45,520 --> 00:15:50,110 So now key one the value inside of there has been overridden with this new string. 250 00:15:50,470 --> 00:15:57,560 And that means if I print out dictionary example dot key one we should get howdy printed here instead. 251 00:15:57,580 --> 00:15:58,780 So if we hit run. 252 00:16:00,180 --> 00:16:00,570 There we go. 253 00:16:00,570 --> 00:16:02,460 We get Hello world and then. 254 00:16:02,490 --> 00:16:02,820 Howdy. 255 00:16:02,850 --> 00:16:03,210 Right. 256 00:16:03,240 --> 00:16:06,330 We've replaced the string of hello with the string of. 257 00:16:06,330 --> 00:16:06,690 Howdy. 258 00:16:07,460 --> 00:16:13,970 If I would like to remove a value out of my dictionary, then what I would do. 259 00:16:14,840 --> 00:16:16,460 Is referred to dictionary example. 260 00:16:16,460 --> 00:16:18,860 Again, get key one. 261 00:16:18,860 --> 00:16:21,620 And inside of here maybe I want to completely remove it. 262 00:16:21,620 --> 00:16:24,740 So I just set the value stored inside of there to nil. 263 00:16:24,740 --> 00:16:28,910 And this is how we remove key value pairs within our dictionaries. 264 00:16:28,910 --> 00:16:35,420 So now if I go and print out the entirety of my dictionary example, we should only have key two left 265 00:16:35,420 --> 00:16:36,830 inside of the table. 266 00:16:36,830 --> 00:16:38,120 So if I hit run. 267 00:16:39,060 --> 00:16:39,420 Here we go. 268 00:16:39,420 --> 00:16:41,070 We get Hello World. 269 00:16:41,070 --> 00:16:42,420 We replaced it with howdy. 270 00:16:42,420 --> 00:16:44,160 And then here is our table. 271 00:16:44,160 --> 00:16:51,150 And as you can see, only key two remains because key one was assigned the value of nil, which automatically 272 00:16:51,150 --> 00:16:53,040 removes it from our dictionary. 273 00:16:54,690 --> 00:16:55,460 All righty. 274 00:16:55,560 --> 00:17:01,440 This was a lot of information to digest, but I would like for you to let this information marinate 275 00:17:01,440 --> 00:17:02,940 in your brain for a little bit. 276 00:17:02,970 --> 00:17:08,700 Tables are the most powerful tool you have in Lua, and you will be using tables a lot in your scripts, 277 00:17:08,700 --> 00:17:13,800 so it's crucial you understand how to create and manipulate tables. 278 00:17:13,830 --> 00:17:16,800 Keep up the good work and I will see you in the next lecture.